/*
** adpcm.h - include file for adpcm coder.
**
** Version 1.0, 7-Jul-92.
*/
#ifndef ADPCM_CODEC_H
#define ADPCM_CODEC_H

#ifdef __cplusplus
extern "C" {
#endif

struct adpcm_state {
	short	valprev;	/* Previous output value */
	char	index;		/* Index into stepsize table */
};

#define	CAUDIOMAGICNUM			0x12345678

#ifndef CAUDIO_FRAME_HEADER_ADPCM
#define CAUDIO_FRAME_HEADER_ADPCM
typedef struct {
	unsigned long magicNum;
	unsigned long audioLength;
	unsigned char audioDataType;
	unsigned char audioDataCheckSum;
	short valprev;		// ADPCM PARAM
	char index;			// ADPCM PARAM
	unsigned char reserved[3];
} CAudioFrameHeader_ADPCM;
#endif

#define AUDIO_MAGIC_NUM_9104D 0xABCD4C6F

typedef struct
{
	unsigned int magicNum; //must equal 0xABCD4C6F
	short valprev;
	char index;
	char reserved;
} ADPCM9104Hdr_S;

void adpcm_coder(short indata[], char outdata[], int len, struct adpcm_state *state);
void adpcm_decoder(char indata[], short outdata[], int len, struct adpcm_state *state);

#ifdef __cplusplus
}
#endif

#endif